//init lodop;_lodop associated file:/report/WebContent/unieap/pages/report/js/doResult.js
var _lodop = null;

dojo.addOnLoad(function(){
	  _lodop = new _lodop_version();
});


var _isPrint = false;
var _start = 1;
var _end = 1;
var rdata = {};
// lodop打印数据对象：主要包含action、reportID等信息
var _LodopData = {};
var LODOP;
var isSubsectionReport=false;
var report_name="unieap report";
// lodop一键打印

function lodopQuickPrint() {
	if (_isPrint) {
		return;
	}
	_isPrint = true;
	var rv = _lodop.getLodop();
	if (!_lodop.checking(rv)) {
		_isPrint = false;
		return;
	}
	
	LODOP = rv.LODOP;
	var rtnvalue = rv.doc;
	if (!(rtnvalue == "" || rtnvalue == null)) {
		document.getElementById("MAIN_printPageInfo_msg_print").innerHTML = rtnvalue;
		document.getElementById("MAIN_printPageInfo_print").style.display = "block";
		_isPrint = false;
		return;
	} else {
		// document.getElementById("printContainer").style.display="block";
	}
	initLodopData();
	
	doSubsectionReportPrint();
	
//	//分段报表，全部打印
//	if(isSubsectionReport){
//		//分段报表的打印全部
//		doSubsectionReportPrint();
//		return;
//	}
//	
//	loadData();
//	// 打印
//	_start = 1;
//	uf_doPrint(_start, _end);
	_isPrint = false;
}
function uf_doPrint(start, end) {
	document.getElementById("MAIN_printPageInfo").style.display = "block";
	if (start > end) {
		document.getElementById("MAIN_printPageInfo_msg").innerHTML = "";
		document.getElementById("MAIN_printPageInfo").style.display = "none";
		_isPrint = false;
		return;
	}
	document.getElementById("MAIN_printPageInfo_msg").innerHTML = "当前打印 : 第"
			+ start + "页" + " " + " 剩余: " + (end - start) + "页  ";
	doPrint(start);
	_start = _start + 1;
	window.setTimeout("uf_doPrint(_start,_end);", 1000);
}

function doPrint(pageNumber) {
	
	var _report_name =rdata.document.name+"_"+pageNumber;
	if(!(_report_name==""||_report_name==null)){
		report_name = _report_name;
	}
	LODOP.PRINT_INIT(report_name);
	LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true);
	LODOP.SET_PRINT_MODE("RESELECT_PAGESIZE",true);
	LODOP.SET_PRINT_MODE("RESELECT_ORIENT",true);
	LODOP.SET_PRINT_MODE("RESELECT_COPIES",true);
	LODOP.SET_PRINT_MODE("CATCH_PRINT_STATUS",true);
	LODOP.SET_PRINT_MODE("POS_BASEON_PAPER",true);
	LODOP.SET_PRINT_MODE("PRINT_END_PAGE",1);
	LODOP.SET_PRINT_STYLEA(0,"Stretch",1);//(可变形)扩展缩放模式
//	LODOP.SET_PRINT_MODE("FULL_HEIGHT_FOR_OVERFLOW",true);//溢出自动缩小
	//zj设置打印机
	LODOP.SET_PRINTER_INDEXA(_LodopData._printService);
	var strPageName = rdata.global.paperSize;
	var intOrient = 1;
	// 0/1,横排/竖排
	if (rdata.global.orientation == "0") {
		intOrient = 1;
	} else if (rdata.global.orientation == "1") {
		intOrient = 2;
	}

	if(strPageName=="自定义"||strPageName==""||strPageName==null){
		strPageName="CreateCustomPage";
	}
	var offset_left = getCookie("cookieLeftMarginOffset");
    if(offset_left==null){
    	offset_left="0";
    	setcookieLeftMarginOffset(offset_left);
    }
	var offset_top = getCookie("cookieTopMarginOffset");
    if(offset_top==null){
    	offset_top="0";
    	setcookieTopMarginOffset(offset_top);
    }
    
	//var marginTop = parseFloat(rdata.global.marginTop)+parseFloat(offset_top);
	//var marginLeft = parseFloat(rdata.global.marginLeft)+parseFloat(offset_left);
	
	var marginTop = parseFloat(offset_top);
	var marginLeft = parseFloat(offset_left);
	//LODOP.SET_PRINT_PAGESIZE(intOrient,rdata.global.width+"mm",rdata.global.height+"mm",strPageName);
	if(strPageName=="CreateCustomPage"){
		var pageHeight=getPageHeight(rdata,pageNumber-1);
		LODOP.SET_PRINT_PAGESIZE(intOrient,rdata.global.width+"mm",pageHeight+"mm",strPageName);
	}else{
		LODOP.SET_PRINT_PAGESIZE(intOrient,0,0,strPageName);
	}

	var html = _lodop.getPrintData(pageNumber, rdata);
	var _Bottom = "100%";
	var _Left = "100%";
	// =====如下空白位置适合调用统一功能(如注册码、语言选择等):====
	LODOP.SET_LICENSES("东软集团股份有限公司",
			"567418B7AB0D48BA46D8D05CDD2CDD47", "", "");
	// ============================================================
    LODOP.ADD_PRINT_HTM(
    		marginTop+"mm",
    		marginLeft+"mm",
    		_Left,//"RightMargin:"+rdata.global.marginRight+"mm",
			_Bottom,//"BottomMargin:"+rdata.global.marginBottom+"mm",
			html);
	LODOP.PRINT();

}

var loadData_xmlhttp=null;
function loadData() {
	var surl =getpaddingUrl("no");
	var url = _LodopData.url+surl;
	var _url = url.substring(0,url.indexOf("."+window.action_suffix+"?")+window.action_suffix.length+1);
	var param = url.substring(url.indexOf("."+window.action_suffix+"?")+window.action_suffix.length+2,url.length);
    
    
	if (window.XMLHttpRequest) { 
    	// Mozilla, Safari,...
		loadData_xmlhttp = new XMLHttpRequest();         
    	if (loadData_xmlhttp.overrideMimeType) {            
    		loadData_xmlhttp.overrideMimeType('text/xml');         
    		}      
    	} else if (window.ActiveXObject) {
    		try {            
    			loadData_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");         
    			} 
    		catch (e) {
    			try {               
    				loadData_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    			} catch (e) {}
    			}      
    		}      
    if (!loadData_xmlhttp) {        
    	alert('Cannot create XMLHTTP instance');         
    	return false;      
    }
	// 发送 异步方式
//    loadData_xmlhttp.onreadystatechange=call_actionDATA_lodopcallbackHandler; 
    loadData_xmlhttp.open('POST', _url, false);  
    loadData_xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");     
    loadData_xmlhttp.setRequestHeader("Content-length", param.length);      
    loadData_xmlhttp.setRequestHeader("Connection", "close");
    loadData_xmlhttp.send(param);
    
	
	// 请求状态处理 非正确返回 则返回处理 不加载
	if (!(loadData_xmlhttp.status == "200" || loadData_xmlhttp.status == "304")) {
		alert("请求报表数据失败:错误代码：" + loadData_xmlhttp.status);
		return;
	}
	// 获取请求文本
	var s = "rdata = " + loadData_xmlhttp.responseText;
	if (window.execScript) {
		window.execScript(s, "JavaScript");// ie
	} else {
		window.eval(s, "JavaScript"); // firefox
	}
	_end = rdata.global.sumPage;
}

// lodop 预览
function lodopPerviewPrint(params) {
	
	if (_isPrint) {
		return;
	}
	var rv = _lodop.getLodop();
	if (!_lodop.checking(rv)) {
		return;
	}
	initLodopData();
	// showModelessDialog
	// 要确保对showModalDialog的调用写在一行中，不能换行。否则polyfill不能正常工作
	var clientWidth=Math.max(document.body.offsetWidth*0.8,900);
	var clientHeight=Math.max(document.body.offsetHeight*0.9,700);
	var rv = window.showModalDialog(report_path+ "/unieap/pages/report/jsp/show/lodop/perview/printPreview-view.jsp", _LodopData, 'dialogWidth:'+clientWidth+'px;dialogHeight:'+clientHeight+'px;minimize:yes;maximize:no;resizable=no;position:absolute;top:30px;',null,top.window||window);

	if(!(rv==null||rv==""||rv=="null")){
		
		var _offsetreturnValue = dojo.fromJson(rv);
		if(_offsetreturnValue.offset_left!=null){
			setcookieLeftMarginOffset(_offsetreturnValue.offset_left);
		}
		if(_offsetreturnValue.offset_top!=null){
			setcookieTopMarginOffset(_offsetreturnValue.offset_top);
		}
	}
	
}

// lodop 数据初始化
function initLodopData() {
	_LodopData = {};
	var isBatch="false";
	if(document.getElementsByName("isBatch").length>0){
		isBatch = document.getElementsByName("isBatch")[0].value;
	}
	var params = document.getElementsByName("unieap_report_params")[0].value;
	var paramsArr;
	if(isBatch==true||isBatch=="true"){//是否批量打印，如果是则传多个参数 liuxiwei
		paramsArr=document.getElementById("batchPrams").value.split(":;");
		params=paramsArr.splice(0,1);
	}
	var reportIdArr = document.getElementById("reportId").value.split(",");
	var reportId = reportIdArr.splice(0,1);
	var cachedId = document.getElementsByName("cachedId")[0].value;
	var isResultant = document.getElementsByName("isResultant")[0];
	var multiDataSegment = document.getElementsByName("multiDataSegment")[0].value;
	var inputDom = document.getElementById("isDataInput");
	var isDataInput = 'false';
	var _printService=document.getElementById("_printService")&&document.getElementById("_printService").value||-1;
	//var reports=document.getElementById("reports").value;
	if (inputDom != null) {
		isDataInput = inputDom.value;
	}
	var isResultantValue = isResultant.getAttribute("value");

	//添加页码标记
	var reportPageStartNum=document.getElementsByName("reportPageStartNum")[0]&&document.getElementsByName("reportPageStartNum")[0].value||0;
	//打印url
	var url = report_path + "/Report-LodopPrintAction."+window.action_suffix+"?reportId=" + reportId
			+ "&unieap_report_params=" + params + "&cachedId=" + cachedId
			+ "&isResultant=" + isResultantValue + "&isDataInput="
			+ isDataInput+"&reportPageStartNum="+reportPageStartNum;

	//报表处理url ,主要应用在分段报表上
	var docurl = report_path + "/Report-DocPrintAction."+window.action_suffix+"?reportId=" + reportId
	+ "&unieap_report_params=" + params + "&cachedId=" + cachedId
	+ "&isResultant=" + isResultantValue + "&isDataInput="
	+ isDataInput+"&reportPageStartNum="+reportPageStartNum;
	
	var loginNameInput = document.getElementById("loginname");
	var tokenInput = document.getElementById("token");
	if (typeof loginNameInput != "undefined"){
		url = url + "&loginname=" + loginNameInput.value;
		url = url + "&token=" + tokenInput.value;
		docurl = docurl + "&loginname=" + loginNameInput.value;
		docurl = docurl + "&token=" + tokenInput.value;
	}
	_LodopData.url = url;
	_LodopData.docurl = docurl;
	_LodopData.reportId = "<%=reportId%>";
	_LodopData.multiDataSegment = multiDataSegment;
	_LodopData.reportIdArr=reportIdArr;
	_LodopData.paramsArr=paramsArr;
	_LodopData.params=params;
	_LodopData.cachedId=cachedId;
	_LodopData.isBatch=isBatch;
	_LodopData.isResultantValue=isResultantValue;
	_LodopData.isDataInput=isDataInput;
	//_LodopData.reports=reports;
	_LodopData._printService=_printService;
	_LodopData.reportPageStartNum=reportPageStartNum;
	 if(_LodopData.multiDataSegment=="true"||_LodopData.multiDataSegment==true){
		 isSubsectionReport=true;
	 }
}
//批量打印初始化
function batchReportPrint(){
	var reportIdArr = _LodopData.reportIdArr;
	if(reportIdArr.length<1){
		return;
	}
	var reportId = reportIdArr.splice(0,1);
	var paramsArr = _LodopData.paramsArr;
	if(paramsArr&&paramsArr.length>=1){//是否批量打印，如果是则传多个参数 liuxiwei
		_LodopData.params=paramsArr.splice(0,1);
	}
	//打印url
	var url = report_path + "/Report-LodopPrintAction."+window.action_suffix+"?reportId=" + reportId
			+ "&unieap_report_params=" + _LodopData.params + "&cachedId=" + _LodopData.cachedId
			+ "&isResultant=" + _LodopData.isResultantValue + "&isDataInput="
			+ _LodopData.isDataInput+"&reportPageStartNum="+_LodopData.reportPageStartNum;
	
	//报表处理url ,主要应用在分段报表上
	var docurl = report_path + "/Report-DocPrintAction."+window.action_suffix+"?reportId=" + reportId
	+ "&unieap_report_params=" + _LodopData.params + "&cachedId=" + _LodopData.cachedId
	+ "&isResultant=" + _LodopData.isResultantValue + "&isDataInput="
	+ _LodopData.isDataInput+"&reportPageStartNum="+_LodopData.reportPageStartNum;
	
	var loginNameInput = document.getElementById("loginname");
	var tokenInput = document.getElementById("token");
	if (typeof loginNameInput != "undefined"){
		url = url + "&loginname=" + loginNameInput.value;
		url = url + "&token=" + tokenInput.value;
		docurl = docurl + "&loginname=" + loginNameInput.value;
		docurl = docurl + "&token=" + tokenInput.value;
	}
	_LodopData.url = url;
	_LodopData.docurl = docurl;
	_LodopData.reportId = "<%=reportId%>";
	_LodopData.reportIdArr=reportIdArr;
	_LodopData.paramsArr=paramsArr;
	//分段报表，全部打印
	doSubsectionReportPrint();
//	if(isSubsectionReport){
//		//分段报表的打印全部
//		doSubsectionReportPrint();
//		return;
//	}
//	
//	loadData();
//	// 打印
//	_start = 1;
//	uf_doPrint(_start, _end);
	_isPrint = false;

}


// =========================分段打印============================================

/**
 * ok
 */
var subsectionPageCount =0;
var subsectionData={};
function doSubsectionReportPrint() {
	//打印之前先截断
	var endurl =getpaddingUrl("end");
	subsectionReportEnd(endurl);
	//重新启动打印
	subsectionPageCount=0;
	var url =getpaddingUrl("start");
	
	document.getElementById("MAIN_printPageInfo").style.display = "block";
	document.getElementById("MAIN_printPageInfo_msg").innerHTML = "";
	
	SubsectionReportCallActionDATA(url);
}

/**
 * @description:
 * 
 * @param: {参数类型} action 参数描述
 * @param: {参数类型} i 参数描述
 * @param: {参数类型} bool 参数描述
 * @return:
 * 
 */
var SubsectionReportCallActionDATA_xmlhttp=null;
function SubsectionReportCallActionDATA(params) {
	// 声明请求对象
	var url = _LodopData.url+params;
	var _url = url.substring(0,url.indexOf("."+window.action_suffix+"?")+window.action_suffix.length+1);
	var param = url.substring(url.indexOf("."+window.action_suffix+"?")+window.action_suffix.length+2,url.length);
    
	
	if (window.XMLHttpRequest) { 
    	// Mozilla, Safari,...
		SubsectionReportCallActionDATA_xmlhttp = new XMLHttpRequest();         
    	if (SubsectionReportCallActionDATA_xmlhttp.overrideMimeType) {            
    		SubsectionReportCallActionDATA_xmlhttp.overrideMimeType('text/xml');         
    		}      
    	} else if (window.ActiveXObject) {
    		try {            
    			SubsectionReportCallActionDATA_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");         
    			} 
    		catch (e) {
    			try {               
    				SubsectionReportCallActionDATA_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    			} catch (e) {}
    			}      
    		}      
    if (!SubsectionReportCallActionDATA_xmlhttp) {        
    	alert('Cannot create XMLHTTP instance');         
    	return false;      
    } 
	// 发送 异步方式
//    SubsectionReportCallActionDATA_xmlhttp.onreadystatechange=call_actionDATA_lodopcallbackHandler; 
    SubsectionReportCallActionDATA_xmlhttp.open('POST', _url, false);  
    SubsectionReportCallActionDATA_xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");     
    SubsectionReportCallActionDATA_xmlhttp.setRequestHeader("Content-length", param.length);      
    SubsectionReportCallActionDATA_xmlhttp.setRequestHeader("Connection", "close");
    SubsectionReportCallActionDATA_xmlhttp.send(param);
    
	
	
	// 请求状态处理 非正确返回 则返回处理 不加载
	if (!(SubsectionReportCallActionDATA_xmlhttp.status == "200" || SubsectionReportCallActionDATA_xmlhttp.status == "304")) {
		alert("请求报表数据失败:错误代码："+SubsectionReportCallActionDATA_xmlhttp.status);
		return;
	}
	
	var s = " subsectionData = "+SubsectionReportCallActionDATA_xmlhttp.responseText;
	if (window.execScript){
		window.execScript(s,"JavaScript");//ie
	 }else{
			window.eval(s,"JavaScript");      //firefox
	}
	//数据返回后输出打印
	var subsectionCount  = subsectionData.global.sumPage;
	if(subsectionCount>0){
		//打印输出
		var i;
		for(i=1;i<=subsectionCount;i++){
			var _i=i;
			subsectionPageCount++;
			doSubsectionReportPrintData(_i,subsectionData);
			window.setTimeout(function (){
				document.getElementById("MAIN_printPageInfo_msg").innerHTML = "分段报表打印,当前打印 : 第"
						+ subsectionCount + "页" ;
				}, 0);
		}
	}
	
	if(subsectionData.document.completed=="true"||subsectionData.document.completed==true){
		//发送终止命令
		var endurl =getpaddingUrl("end");
		document.getElementById("MAIN_printPageInfo").style.display = "none";
		document.getElementById("MAIN_printPageInfo_msg").innerHTML = "";
		subsectionReportEnd(endurl);
		batchReportPrint();
	}else{
		//继续获取数据并打印
		var url =getpaddingUrl("");
		SubsectionReportCallActionDATA(url);
	}
}

var subsectionReportEnd_xmlhttp=null;
function subsectionReportEnd(params) {
	// 声明请求对象
	var url = _LodopData.docurl+params;
	var _url = url.substring(0,url.indexOf("."+window.action_suffix+"?")+window.action_suffix.length+1);
	var param = url.substring(url.indexOf("."+window.action_suffix+"?")+window.action_suffix.length+2,url.length);
	
    
	if (window.XMLHttpRequest) { 
    	// Mozilla, Safari,...
		subsectionReportEnd_xmlhttp = new XMLHttpRequest();         
    	if (subsectionReportEnd_xmlhttp.overrideMimeType) {            
    		subsectionReportEnd_xmlhttp.overrideMimeType('text/xml');         
    		}      
    	} else if (window.ActiveXObject) {
    		try {            
    			subsectionReportEnd_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");         
    			} 
    		catch (e) {
    			try {               
    				subsectionReportEnd_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    			} catch (e) {}
    			}      
    		}      
    if (!subsectionReportEnd_xmlhttp) {        
    	alert('Cannot create XMLHTTP instance');         
    	return false;      
    } 
	// 发送 异步方式
//    subsectionReportEnd_xmlhttp.onreadystatechange=call_actionDATA_lodopcallbackHandler; 
    subsectionReportEnd_xmlhttp.open('POST', _url, false);  
    subsectionReportEnd_xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");     
    subsectionReportEnd_xmlhttp.setRequestHeader("Content-length", param.length);      
    subsectionReportEnd_xmlhttp.setRequestHeader("Connection", "close");
    subsectionReportEnd_xmlhttp.send(param);
    
    
	
	
	
	// 请求状态处理 非正确返回 则返回处理 不加载
	if (!(subsectionReportEnd_xmlhttp.status == "200" || subsectionReportEnd_xmlhttp.status == "304")) {
		alert("请求报表数据失败:错误代码："+subsectionReportEnd_xmlhttp.status);
		return;
	}
	//报表截断终止
}

/**
 * 分段报表打印当前段
 */
function doSubsectionReportPrintData(index,_subsectionCount){
	
	var _report_name =_subsectionCount.document.name+"_"+index;
	if(!(_report_name==""||_report_name==null)){
		report_name = _report_name;
	}
	LODOP.PRINT_INIT(report_name);
	LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true);
	LODOP.SET_PRINT_MODE("RESELECT_PAGESIZE",true);
	LODOP.SET_PRINT_MODE("RESELECT_ORIENT",true);
	LODOP.SET_PRINT_MODE("RESELECT_COPIES",true);
	LODOP.SET_PRINT_MODE("CATCH_PRINT_STATUS",true);
	LODOP.SET_PRINT_MODE("POS_BASEON_PAPER",true);
	LODOP.SET_PRINT_MODE("PRINT_END_PAGE",1);
	LODOP.SET_PRINT_STYLEA(0,"Stretch",1);//(可变形)扩展缩放模式
//	LODOP.SET_PRINT_MODE("FULL_HEIGHT_FOR_OVERFLOW",true);//溢出自动缩小
	//zj设置打印机
	LODOP.SET_PRINTER_INDEXA(_LodopData._printService);
	var strPageName = _subsectionCount.global.paperSize;
	var intOrient = 1;
	// 0/1,横排/竖排
	if (_subsectionCount.global.orientation == "0") {
		intOrient = 1;
	} else if (_subsectionCount.global.orientation == "1") {
		intOrient = 2;
	}

	if(strPageName=="自定义"||strPageName==""||strPageName==null){
		strPageName="CreateCustomPage";
	}
	//LODOP.SET_PRINT_PAGESIZE(intOrient,_subsectionCount.global.width+"mm",_subsectionCount.global.height+"mm",strPageName);
	
	if(strPageName=="CreateCustomPage"){
		var pageHeight=getPageHeight(_subsectionCount,index-1);
		LODOP.SET_PRINT_PAGESIZE(intOrient,_subsectionCount.global.width+"mm",pageHeight+"mm",strPageName);
	}else{
		LODOP.SET_PRINT_PAGESIZE(intOrient,0,0,strPageName);
	}
	
	var offset_left = getCookie("cookieLeftMarginOffset");
    if(offset_left==null){
    	offset_left="0";
    	setcookieLeftMarginOffset(offset_left);
    }
	var offset_top = getCookie("cookieTopMarginOffset");
    if(offset_top==null){
    	offset_top="0";
    	setcookieTopMarginOffset(offset_top);
    }
    
//	var marginTop = parseFloat(_subsectionCount.global.marginTop)+parseFloat(offset_top);
//	var marginLeft = parseFloat(_subsectionCount.global.marginLeft)+parseFloat(offset_left);
	var marginTop = parseFloat(offset_top);
	var marginLeft = parseFloat(offset_left);
	var html = _lodop.getPrintData(index, _subsectionCount);
	var _Bottom = "100%";
	var _Left = "100%";
	// =====如下空白位置适合调用统一功能(如注册码、语言选择等):====
	LODOP.SET_LICENSES("东软集团股份有限公司",
			"567418B7AB0D48BA46D8D05CDD2CDD47", "", "");
	// ============================================================
    LODOP.ADD_PRINT_HTM(
    		marginTop+"mm",
    		marginLeft+"mm",
    		_Bottom,//"RightMargin:"+_subsectionCount.global.marginRight+"mm",
    		_Left,//"BottomMargin:"+_subsectionCount.global.marginBottom+"mm",
			html);
	LODOP.PRINT();
	
}


function getpaddingUrl(session){
	var _url ="";
	//根据不同的报表分段类型设置session参数
	if(session == null){
		_url= _url+"&session="+"no";
	}else{
		_url= _url+"&session="+session;
	}
     return _url;
}

function getPageHeight(data,pageNumber){
	var pageHeight=data.global.height;
	if(data.global.fitPrintHeight){
//	if(pageHeight<0){
//		if(data.global.sumPage>1&&pageNumber==data.global.sumPage-1){
//			pageHeight=data.pagesHeight&&data.pagesHeight[pageNumber-1].height;
//		}else{
//			pageHeight=data.pagesHeight&&data.pagesHeight[pageNumber].height;
//		}
		pageHeight=data.pagesHeight&&data.pagesHeight[pageNumber].height;
		if(pageHeight<150){
				pageHeight=pageHeight+20;
		}
		
		var _report_name =data.document.name+"_"+pageNumber;
		if(!(_report_name==""||_report_name==null)){
			report_name = _report_name;
		}
		LODOP.SET_PRINT_MODE("CUSTOM_TASK_NAME",report_name);//为每个打印单独设置任务名
	}
	return pageHeight;
}


